package com.hmkx.app.rest;

import com.hmkx.app.entity.Articles;
import com.hmkx.app.fegin.MemberFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hht
 * @ClassName MemberController
 * @Description TODO
 * @Date 2020/1/14 11:45
 * @VERSION 1.0
 */
@RestController
@Api(description = "用户相关接口",tags={"用户接口"})
@RequestMapping(value = "member")
public class MemberController {

    @Autowired
    private MemberFeignClient memberFeignClient;


    @ApiOperation(value = "根据memToken获取用户信息",notes="注意事项")
    @ApiImplicitParam(name = "token",value = "登录令牌",dataType = "String",paramType = "query")
    @RequestMapping(value="/findOneMemByToken", method = RequestMethod.GET)
    public String findOneMemByToken(@RequestParam String token){
        String result = memberFeignClient.getBaseMemByToken("{\"memToken\":\""+token+"\"}");
        return result;
    }


}
